package com.o2o.app.userCenter;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.o2o.app.R;

public class MineFamilyListActivity extends Activity {
	/**
	 * 加入家庭返回按钮
	 */
	private Button btn_back;

	/**
	 * 家庭资料按钮
	 */
	private Button btn_fpass;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.mine_family_list);

		initViews();

		showView();
	}

	private void initViews() {
		btn_back = (Button) findViewById(R.id.btn_back);
		btn_back.setOnClickListener(new ClickEvent());

		btn_fpass = (Button) findViewById(R.id.btn_fpass);
		btn_fpass.setOnClickListener(new ClickEvent());
	}

	/**
	 * 点击事件
	 * 
	 * @author Administrator
	 * 
	 */
	class ClickEvent implements View.OnClickListener {

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			switch (v.getId()) {
			case R.id.btn_back: { // 加入家庭返回按钮
				finish();
			}
				break;
			case R.id.btn_fpass: { // 点击家庭资料
				Intent intent = new Intent(MineFamilyListActivity.this,
						FamilyDataActivity.class);
				startActivity(intent);

			}
				break;
			default:
				break;
			}
		}

	}

	/**
	 * 显示已发布
	 */
	private void showView() {
		LinearLayout layout = (LinearLayout) findViewById(R.id.lly_all_content01);
		// layout.removeAllViews();
		layout.setVisibility(View.VISIBLE);

		for (int i = 0; i < 2; i++) {
			LinearLayout child = (LinearLayout) LayoutInflater.from(
					MineFamilyListActivity.this).inflate(
					R.layout.mine_family_list_item, null);
			child.setId(i);

			layout.addView(child);
		}
	}
}
